<template>
	<view class="cu-form-group">
		<view class="title">地址选择</view>
		<picker mode="region" @change="RegionChange" :value="region">
			<view class="picker">
				<view class="text-lg color-place" v-if="arrToStr == '1,1,1'">
					请选择地区
				</view>
				<view v-else>{{region[0]}}，{{region[1]}}，{{region[2]}}</view>
			</view>
		</picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				index: -1,
				region: ['1', '1', '1']
			}
		},
		props: {
			isSingleRow: {
				type: Boolean,
				default: true
			}
		},
		computed:{
			arrToStr(){
				return this.region.toString();
			}
		},
		methods: {
			RegionChange(e) {
				this.region = e.detail.value;
				this.$emit('chooseCity', e.detail.value)
			},
			PickerChange(e) {
				this.index = e.detail.value
			},
		}
	}
</script>

<style>
	.cu-form-group picker .picker {
		text-align: left;
	}
</style>
